<template>
  <div
    class="E-page-video"
    v-loading="load"
    element-loading-text="拼命加载中..."
    element-loading-spinner="el-icon-loading"
  >
    {{dataArr}}
    <E-pagination @change="(p,l)=>getData(keywords,p,l)" :total="total" background />
  </div>
</template>

<script>
export default {
  props: ['keywords'],
  components: {
    'E-pagination': () => import('@/components/high-reuse/E-pagination')
  },
  data() {
    return {
      load: false,
      total: 0,
      dataArr: []
    };
  },
  methods: {
    getData(keywords, offset, limit) {
      this.load = true;
      this.$api.get('search', {
        keywords, offset, limit, type: 1004
      }, true).then(({ result }) => {
        this.total = result.mvCount;
        this.dataArr = result.mvs;
        console.log(result);
      }).finally(() => { this.load = false; });
    }
  }
};
</script>

<style lang="scss" scoped>
.E-page-video {
}
</style>
